UPDATE taxonomy
SET prot_domain=null, prot_phylum=null, prot_class=null, prot_order=null, prot_family=null, prot_genus=null, prot_species=null, prot_hit=null
where prot_evalue>1e-17;

UPDATE taxonomy
SET final_domain = "Eukaryota", final_phylum = "Arthropoda", state_taxo = "Assigned"
WHERE (nucl_phylum LIKE "Arthropoda" OR prot_phylum LIKE "Arthropoda") AND state_taxo isnull;

UPDATE taxonomy
SET final_domain = nucl_domain, final_phylum = nucl_phylum, final_class = nucl_class, final_order = nucl_order,  final_family = nucl_family,  final_genus = nucl_genus, final_species = nucl_species , state_taxo = "Assigned"
WHERE nucl_Evalue = 0 AND state_taxo isnull;

UPDATE taxonomy
SET final_domain = prot_domain
WHERE state_taxo isnull AND prot_domain=nucl_domain;

UPDATE taxonomy
SET final_phylum = prot_phylum
WHERE state_taxo isnull AND prot_phylum=nucl_phylum;

UPDATE taxonomy
SET final_class = prot_class
WHERE state_taxo isnull AND prot_class=nucl_class;

UPDATE taxonomy
SET final_order = prot_order
WHERE state_taxo isnull AND prot_order=nucl_order;

UPDATE taxonomy
SET final_family = prot_family
WHERE state_taxo isnull AND prot_family=nucl_family;

UPDATE taxonomy
SET final_genus = prot_genus
WHERE state_taxo isnull AND prot_genus=nucl_genus;

UPDATE taxonomy
SET final_species = prot_species
WHERE state_taxo isnull AND prot_species=nucl_species;

UPDATE taxonomy
SET state_taxo = "Assigned"
WHERE state_taxo isnull AND final_domain not LIKE "";

UPDATE taxonomy
SET final_domain = prot_domain
WHERE state_taxo isnull AND nucl_domain isnull;

UPDATE taxonomy
SET final_phylum = prot_phylum
WHERE state_taxo isnull AND nucl_phylum isnull;

UPDATE taxonomy
SET final_class = prot_class
WHERE state_taxo isnull AND nucl_class isnull;

UPDATE taxonomy
SET final_order = prot_order
WHERE state_taxo isnull AND nucl_order isnull;

UPDATE taxonomy
SET final_family = prot_family
WHERE state_taxo isnull AND nucl_family isnull;

UPDATE taxonomy
SET final_genus = prot_genus
WHERE state_taxo isnull AND nucl_genus isnull;

UPDATE taxonomy
SET final_species = prot_species
WHERE state_taxo isnull AND nucl_species isnull;

UPDATE taxonomy
SET final_domain = nucl_domain
WHERE state_taxo isnull AND prot_domain isnull;

UPDATE taxonomy
SET final_phylum = nucl_phylum
WHERE state_taxo isnull AND prot_phylum isnull;

UPDATE taxonomy
SET final_class = nucl_class
WHERE state_taxo isnull AND prot_class isnull;

UPDATE taxonomy
SET final_order = nucl_order
WHERE state_taxo isnull AND prot_order isnull;

UPDATE taxonomy
SET final_family = nucl_family
WHERE state_taxo isnull AND prot_family isnull;

UPDATE taxonomy
SET final_genus = nucl_genus
WHERE state_taxo isnull AND prot_genus isnull;

UPDATE taxonomy
SET final_species = nucl_species
WHERE state_taxo isnull AND prot_species isnull;

UPDATE taxonomy
SET state_taxo = "Assigned"
WHERE state_taxo isnull AND final_domain not null;

UPDATE taxonomy
SET state_taxo = "Not assigned"
WHERE state_taxo isnull;